<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

	<table align="center" border="3" width="800px">
		<c:if test="${map.cmt_list.size() != 0}">
		<tr>
			<td style="height: 30px; line-height: 30px; text-align: center; background-color: orange; font-family: Tahoma;">
				<b><font color="red">${map.cmt_list.size()}</font>&nbsp;개의 댓글이 있습니다.</b>
		<c:forEach var="row" items="${map.cmt_list}">
		<tr>
			<td style="font-family: Tahoma; font-weight: bolder; background-color: menu;">
				<img src="${path}/images/lv/${row.level}.gif" style="margin-left: 10px;"> 
				<span style="margin-left: 10px;">USER ID : ${row.userid}</span> 
				<span style="margin-left: 10px;">${row.post_date}</span>
				<c:if test="${sessionScope.userid == row.userid }">
				<span style="float: right; margin-right: 10px;">
					<input type="button" id="btnCmtDel" name="btnCmtDel" value="삭제" onclick="cmtDelete()">
					<input type="hidden" id="btnCmtIdx" value="${row.idx }">
				</span>
				</c:if>
		<tr>
			<td style="padding: 5px;">
				<span style="background-color: black;">
				<c:choose>
					<c:when test="${row.rate == 1}">
					<img src="${path}/images/icons/star1.png" width="15px" height="15">
					<img src="${path}/images/icons/star2.png" width="15px" height="15">
					<img src="${path}/images/icons/star2.png" width="15px" height="15">
					<img src="${path}/images/icons/star2.png" width="15px" height="15">
					<img src="${path}/images/icons/star2.png" width="15px" height="15">
					</c:when>
					<c:when test="${row.rate == 2}">
					<img src="${path}/images/icons/star1.png" width="15px" height="15">
					<img src="${path}/images/icons/star1.png" width="15px" height="15">
					<img src="${path}/images/icons/star2.png" width="15px" height="15">
					<img src="${path}/images/icons/star2.png" width="15px" height="15">
					<img src="${path}/images/icons/star2.png" width="15px" height="15">
					</c:when>
					<c:when test="${row.rate == 3}">
					<img src="${path}/images/icons/star1.png" width="15px" height="15">
					<img src="${path}/images/icons/star1.png" width="15px" height="15">
					<img src="${path}/images/icons/star1.png" width="15px" height="15">
					<img src="${path}/images/icons/star2.png" width="15px" height="15">
					<img src="${path}/images/icons/star2.png" width="15px" height="15">
					</c:when>
					<c:when test="${row.rate == 4}">
					<img src="${path}/images/icons/star1.png" width="15px" height="15">
					<img src="${path}/images/icons/star1.png" width="15px" height="15">
					<img src="${path}/images/icons/star1.png" width="15px" height="15">
					<img src="${path}/images/icons/star1.png" width="15px" height="15">
					<img src="${path}/images/icons/star2.png" width="15px" height="15">
					</c:when>
					<c:when test="${row.rate == 5}">
					<img src="${path}/images/icons/star1.png" width="15px" height="15">
					<img src="${path}/images/icons/star1.png" width="15px" height="15">
					<img src="${path}/images/icons/star1.png" width="15px" height="15">
					<img src="${path}/images/icons/star1.png" width="15px" height="15">
					<img src="${path}/images/icons/star1.png" width="15px" height="15">
					</c:when>
					<c:otherwise>
					<img src="${path}/images/icons/star2.png" width="15px" height="15">
					<img src="${path}/images/icons/star2.png" width="15px" height="15">
					<img src="${path}/images/icons/star2.png" width="15px" height="15">
					<img src="${path}/images/icons/star2.png" width="15px" height="15">
					<img src="${path}/images/icons/star2.png" width="15px" height="15">
					</c:otherwise>
				</c:choose>
				</span>
				<span style="margin-left: 30px;">${row.comment }</span>
		</c:forEach>
		</c:if>
		<c:if test="${map.cmt_list.size() == 0}">
		<tr>
			<td style="height: 100px; line-height: 100px; text-align: center;"><b>게시물에 등록된 덧글이 없습니다.</b>
		</c:if>
		</table>
